package com.project.junM.controller;

import com.project.junM.entity.TSetmeal;
import com.project.junM.service.TSetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/setmeal")
public class SetmealController {

    @Autowired
    private TSetmealService tSetmealService;

    @GetMapping("querySetmealAll")
    public List<TSetmeal> querySetmealAll(){
        return tSetmealService.querySetMealAll();
    }

    @GetMapping("queryBySexAll")
    public List<TSetmeal> queryBySexAll(String sex){
        return tSetmealService.queryBySexAll(sex);
    }

    @GetMapping("/queryBySetmaelId")
    public List<TSetmeal> queryBySetmaelId(Integer setmealId){
        return tSetmealService.selectByPrimaryKey(setmealId);
    }

}
